﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Mechanics.GameEventMechanics {
    import Mechanics.GameMechanicInterfaces.*;
    import Mechanics.*;
    import Modules.stats.experiments.*;
    import Modules.crew.*;

    public class RollCallDialogMechanic extends DialogGenerationMechanic implements IDialogGenerationMechanic {

        override public function canPopDialog():Boolean{
            var _local1:RollCallDataMechanic = (MechanicManager.getInstance().getMechanicInstance(m_owner, "rollCall", MechanicManager.ALL) as RollCallDataMechanic);
            var _local2:int = Global.experimentManager.getVariant(ExperimentDefinitions.EXPERIMENT_ROLL_CALL);
            var _local3 = (Global.player.level < _local1.requiredLevel);
            if ((((((_local2 <= 1)) || (_local3))) && (!(Global.isVisiting())))){
                return (false);
            };
            var _local4:RollCallDataMechanic = (MechanicManager.getInstance().getMechanicInstance(m_owner, "rollCall", MechanicManager.ALL) as RollCallDataMechanic);
            var _local5:String = _local4.getState();
            if (((_local4.isActiveObject()) && ((((_local5 == RollCallDataMechanic.STATE_IN_PROGRESS)) || (_local4.canCollect(Global.player.uid)))))){
                RollCallManager.debugSample("DialogMechanicTrue", "activeAndCanUse");
                return (true);
            };
            return (false);
        }

    }
}//package Mechanics.GameEventMechanics 
